package com.enniswu.weitter;

import android.content.Context;

import com.enniswu.weitter.data.local.SPSupport;
import com.enniswu.weitter.util.ImageUtil;
import com.enniswu.weitter.util.Utility;

import skin.support.SkinCompatManager;
import skin.support.app.SkinCardViewInflater;
import skin.support.constraint.app.SkinConstraintViewInflater;
import skin.support.design.app.SkinMaterialViewInflater;

public class Application extends android.app.Application {

    private static Context context;

    public static Context getContext() {
        return context;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        context = this;
        SkinCompatManager.withoutActivity(this)
                .addInflater(new SkinMaterialViewInflater())
                .addInflater(new SkinConstraintViewInflater())
                .addInflater(new SkinCardViewInflater())
                .loadSkin();
        ImageUtil.saveDefaultPortrait(this);
        Utility.setLanguage(this, SPSupport.getInstance().getLanguage());
    }
}
